#include "bsp_flash.h"
#include "user_common.h"




struct IAP_DATA_STR
{
		uint16_t flag;
		uint16_t crc;
		uint16_t firmend;
};


void IAP_Jump_Boot(void)
{
		struct IAP_DATA_STR		iap_data;
		memcpy(&iap_data,(void *)(PAGE2_BASE_ADDRESS),8);
		HAL_FLASH_Unlock();
	  iap_data.flag = 3;
		Flash_ErasePage(PAGE2_BASE_ADDRESS,1);
		Flash_Write(PAGE2_BASE_ADDRESS,(void *)&iap_data,1);		
		HAL_FLASH_Lock();
		HAL_NVIC_SystemReset();
}


